<?php if(!defined('BASEPATH')) exit ('No direct script access allowed');
class Index_admin extends CI_Controller{
	function __construct(){
		parent::__construct();
		if($this->session->userdata('DX_user_id') == false){
			redirect('','location');
		}else{
			if($this->session->userdata('DX_role_id') !== "2"){
				redirect('','location');
			}
		}
		$this->load->library('template');
	}
	function index(){
		$this->template->set_master_template('admin/index');
		$this->template->write_view('header', 'admin/header');
		$this->template->write_view('sidebar', 'admin/sidebar');
		$this->template->write_view('content', 'admin/pages/dashboard');
		$this->template->write('footer', 'Isi Footer');
		$this->template->render();
	}
	function action(){
		$action = trim($_POST['action']) ? @$_POST['action'] : @$_GET['action'];
		switch($action){
			default:
				echo "{ failure : true }";
			break;
		}
	}
}
?>